<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
	<jsp:include page="${ctx }/WEB-INF/view/meta.jsp"></jsp:include>
	<script type="text/javascript" src="${ctx}/resource/js/admin/role.js?r=${random}"></script>
</head>
<body>
	<div class="easyui-panel" data-options="fit:true,height:'100%',title:'查询结果'">
		<!-- DataGrid -->
		<table id="data-grid" class="easyui-datagrid" 
			data-options="fitColumns:true, singleSelect:true, fit:true, pagination:true, 
				rownumbers:true, toolbar:'#toolbar', selectOnCheck:true, pageSize:20, url:'/admin/role/search'">
			<thead>
		        <tr>
		        	<th data-options="field:'id', checkbox:true, width:60"></th>
		            <th data-options="field:'role', width:200">角色名称</th>
		            <th data-options="field:'description', width:200">角色描述</th>
		        </tr>
		    </thead>
		    <tbody></tbody>
		</table>
	</div>
	<div id="toolbar">
		<a href="javascript:Role.beforeAdd()" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a>
		<a href="javascript:Role.beforeAuthorization()" class="easyui-linkbutton" data-options="iconCls:'icon-add'">授权</a>
	    <a href="javascript:Role.beforeUpdate()" class="easyui-linkbutton" data-options="iconCls:'icon-cut'">修改</a>
	    <a href="javascript:Role.deleteRole()" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">删除</a>
	</div>
	
	<!-- Add Form -->
	<div id="add-dialog" class="easyui-dialog" style="padding:10px; width: 420px;" 
		data-options="closed:true, title:'编辑', buttons:'#add-dialog-buttons'">
		<form id="add-form" method="post" data-options="novalidate: false">
			<input type="hidden" name="id" />
			<ul class="simple-ul">
				<li>
		        	<label>角色名称：</label>
					<input id="role" name="role" class="easyui-textbox add-input" data-options="required:true">
		        </li>
		        <li>
		        	<label>描述：</label>
					<input name="description" class="easyui-textbox add-input" data-options="required:true">
		        </li>
	        </ul>
	    </form>
	</div>
	<div id="add-dialog-buttons" style="text-align:center;">
		<a href="javascript:Role.addRole()" class="easyui-linkbutton c6 search-button" data-options="iconCls:'icon-ok'">提交</a>
    	<a href="javascript:App.closeAddDialog()" class="easyui-linkbutton search-button" data-options="iconCls:'icon-cancel'">取消</a>
	</div>
	
	<div id="add-authorization" class="easyui-dialog" style="padding:10px; width: 420px;" 
		data-options="closed:true, title:'授权', buttons:'#add-authorization-buttons'">
		<input type="hidden" id="roleId" />
		<ul id="authorization-tree" class="easyui-tree" data-options="checkbox:true, animate:true"></ul>
	</div>
	<div id="add-authorization-buttons" style="text-align:center;">
		<a href="javascript:Role.authorization()" class="easyui-linkbutton c6 search-button" data-options="iconCls:'icon-ok'">提交</a>
    	<a href="javascript:Role.closeAuthorizationDialog()" class="easyui-linkbutton search-button" data-options="iconCls:'icon-cancel'">取消</a>
	</div>
</body>
</html>